/****************************************************************************\
 Datei  : Guarded.cpp
 Projekt: SYS - Systemkomponenten
 Inhalt : CGuarded Implementierung
 Datum  : 14.11.2000
 Autor  : CR - Christian Rodemeyer
 Hinweis: 
 Stempel: $Modtime: 17.12.00 14:51 $, $Author: Cr $, $NoKeywords: $ 
\****************************************************************************/

#include "StdAfx.h"
#include "Guarded.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;                      
#endif

// ============
namespace SYS {
// ============

/****************************************************************************\
 CGuarded: Implementierung
\****************************************************************************/
CGuard::CGuard(const CCriticalSection* pGuarded)
{
  m_pGuarded = const_cast<CCriticalSection*>(pGuarded);
  m_pGuarded->EnterCriticalSection();
}

CGuard::CGuard(const CCriticalSection& guarded)
{
  m_pGuarded = const_cast<CCriticalSection*>(&guarded);
  m_pGuarded->EnterCriticalSection();
}

}; // namespace SYS
 